import { createRouter, createWebHashHistory } from "vue-router";
import IndexView from "../views/IndexView.vue";
import DoctorView from "../views/DoctorView.vue";
import LoginView from "../views/LoginView.vue";
import DrugView from "../views/DrugView.vue";
import CityView from "../views/CityView.vue";
import MedicalPolicyView from "../views/MedicalPolicyView.vue";
import DrugCompanyView from "../views/DrugCompanyView.vue";
import CompanyPolicyTableComponent from "../components/CompanyPolicyTableComponent.vue";
import MaterialComponentTable from "../components/MaterialComponentTable.vue";

const routes = [
  {
    path: "/",
    component: IndexView,
  },
  {
    path: "/index",
    name: "index",
    component: IndexView,
    //     todo 这里嵌套子页面
    children: [
      {
        path: "doctor",
        name: "doctor",
        component: DoctorView,
      },
      {
        path: "drug",
        name: "drug",
        component: DrugView,
      },
      {
        path: "city",
        name: "city",
        component: CityView,
      },
      {
        path: "medicalPolicy",
        name: "medicalPolicy",
        component: MedicalPolicyView,
      },
      {
        path: "drugCompany",
        name: "drugCompany",
        component: DrugCompanyView,
      },
      {
        path: "companyPolicy",
        name: "companyPolicy",
        component: CompanyPolicyTableComponent,
      },
      {
        path: "material",
        name: "material",
        component: MaterialComponentTable,
      },
    ],
  },
  {
    path: "/login",
    name: "login",
    component: LoginView,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
